<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>${serviceInfo.serviceName}</title>
  <${r"#"}include "/include/layui-top.html">
  <style>
  /* 以下代码解决layer中select引发的滚动条问题，有需要时打开注释 */
  /* .layui-layer-page .layui-layer-content { overflow: visible !important; } */
  </style>
</head>
<body style='overflow: scroll;overflow:hidden'>
<form id="search-form" class="layui-form layui-card-body" action="javascript:void(0);">
  <div class="layui-form-item">
  <#list serviceInfo.columns as columnInfo>
  <#if (columnInfo_index > 4)>
  <!-- 
  </#if>
  <#if (columnInfo.dataType == "datetime")||(columnInfo.dataType == "timestamp")>
    <div class="layui-inline">
	  <input class="layui-input" type="text" id="${columnInfo.javaCode}${columnInfo.TIMESTARTSTR}" name="${columnInfo.javaCode}${columnInfo.TIMESTARTSTR}" autocomplete="off" placeholder="<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}开始<#else>${columnInfo.columnCode}${columnInfo.TIMESTARTSTR}</#if>" readonly />
    </div>
    <div class="layui-inline">
	  <input class="layui-input" type="text" id="${columnInfo.javaCode}${columnInfo.TIMEENDSTR}" name="${columnInfo.javaCode}${columnInfo.TIMEENDSTR}" autocomplete="off" placeholder="<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}截止<#else>${columnInfo.columnCode}${columnInfo.TIMEENDSTR}</#if>" readonly />
    </div>
  <#elseif (columnInfo.dataType="enum")>
  	<div class="layui-inline">
	  <select name="${columnInfo.javaCode}" lay-verify="">
		<option value="">${columnInfo.columnRemark!}</option>
		<${r'#'}list ${columnInfo.tableClazzCode?uncap_first}${columnInfo.javaCode?cap_first}Enum as item>
		<option value="${r'$'}{item.code}">${r'$'}{item.message}</option>
		</${r'#'}list>
	  </select>      
	</div>
  <#elseif (columnInfo.javaType="Boolean")>
  	<div class="layui-inline">
	  <select name="${columnInfo.javaCode}" lay-verify="">
		<option value="">${columnInfo.columnRemark!}</option>
		<option value="1">是</option>
		<option value="0">否</option>
	  </select>      
	</div>
  <#else>
  	<div class="layui-inline">
  	  <input class="layui-input" <#if (columnInfo.dataType=="bigint"||columnInfo.dataType=="int"||columnInfo.dataType=="double"||columnInfo.dataType=="decimal"||columnInfo.dataType=="float")>type="number"<#else>type="text"</#if> id="${columnInfo.javaCode}" name="${columnInfo.javaCode}" autocomplete="off" placeholder="<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}<#else>${columnInfo.columnCode}</#if>" />
    </div>
  </#if>
  <#if (columnInfo_index > 4)>
  -->
  </#if>
  </#list>
    <div class="layui-inline">
    	<div class="layui-btn-group">
    		<button class="layui-btn" lay-submit lay-filter="search-opt">查询</button>
    		<button class="layui-btn" id="search-more">查询更多</button>
    		<button class="layui-btn layui-btn-normal" type="reset">重置</button>
    	</div>
    </div>
  </div>
  <table id="table" lay-size="sm" class="layui-hide" lay-filter="table"></table>
</form>
<${r"#"}include "/include/layui-end.html">
<script type="text/html" id="toolbar">
  <div class="layui-btn-group">
	<${r'@'}shiro.hasPermission name="${serviceInfo.serviceName?uncap_first}_add_opt">
    <button class="layui-btn layui-btn-sm" lay-event="addData-opt">
	  <i class="layui-icon">&#xe654;</i> 新增
	</button>
	</${r'@'}shiro.hasPermission>
	<${r'@'}shiro.hasPermission name="${serviceInfo.serviceName?uncap_first}_delete_opt">
	<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batch-del-opt">
	  <i class="layui-icon">&#xe640;</i> 批量删除
	</button>
	</${r'@'}shiro.hasPermission>
  </div>
  <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="refresh-opt">
	<i class="layui-icon">&#xe669;</i> 刷新
  </button>
</script>
<script type="text/html" id="optbar">
  <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="view-opt">查看</a>
  <${r'@'}shiro.hasPermission name="${serviceInfo.serviceName}_edit_opt">
  <a class="layui-btn layui-btn-xs" lay-event="edit-opt">编辑</a>
  </${r'@'}shiro.hasPermission>
  <${r'@'}shiro.hasPermission name="${serviceInfo.serviceName}_delete_opt">
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del-opt">删除</a>
  </${r'@'}shiro.hasPermission>
</script>
<script>
	layui.config({
		base: '/components/app/${urlPrefix}/${serviceInfo.serviceName}/'
	}).use(['${serviceInfo.serviceName}Page']);
</script>
</body>
<!-- windows弹窗定义开始 -->
<div id="windows" style="display: none;">
	<form class="layui-form layui-fluid" id="win-form" lay-filter="win-form" action="javascript:;">
		<!-- 示例区开始 -->
		<!-- 
		<div class="layui-form-item">
	        <label class="layui-form-label">单列示例</label>
	        <div class="layui-input-block" style="margin-right: 45px;">
	            <input class="layui-input" type="text" id="example_id" name="example_id" placeholder="示例字段" autocomplete="off" />
	            <textarea id="example_id" name="example_id" placeholder="示例字段" class="layui-textarea" rows="10"></textarea>
	        </div>
	    </div>
	    -->
		<!-- 示例区结束 -->
		
	    <!-- 隐藏字段区开始。注意：隐藏字段严禁使用type=hidden，表单重置将无效，正确方法是设置style样式display:none; -->
	    
	    <!-- 隐藏字段区结束 -->
	<#list serviceInfo.columns as columnInfo>
	    <#if (columnInfo_index%2==0)>
	    <div class="layui-form-item">
	    </#if>
		    <!-- 新增编辑窗口：<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}<#else>${columnInfo.columnCode}</#if>属性 -->
	        <div class="layui-inline">
	            <label class="layui-form-label"><#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}<#else>${columnInfo.columnCode}</#if></label>
	            <div class="layui-input-inline">
	            <#if (columnInfo.javaType="Boolean")>
	              <input type="checkbox" name="${columnInfo.javaCode}" lay-skin="switch" value="1" lay-text="是|否">
	            <#elseif (columnInfo.dataType="enum")>
				  <select name="${columnInfo.javaCode}" lay-filter="${columnInfo.javaCode}-win" lay-verify="">
					<option value="">${columnInfo.columnRemark!}</option>
					<${r'#'}list ${columnInfo.tableClazzCode?uncap_first}${columnInfo.javaCode?cap_first}Enum as item>
					<option value="${r'$'}{item.code}">${r'$'}{item.message}</option>
					</${r'#'}list>
				  </select>      
	            <#else>
	                <input class="layui-input<#if (columnInfo.prikey)> layui-hide</#if>" id="${columnInfo.javaCode}-win" name="${columnInfo.javaCode}" placeholder="<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}<#else>${columnInfo.columnCode}</#if>" <#if (columnInfo.dataType == "datetime")||(columnInfo.dataType == "timestamp")>readonly</#if> <#if (!columnInfo.nullAble)&&(!columnInfo.prikey)>lay-verify="required"</#if> autocomplete="off" />
	            </#if>
	            </div>
	        </div>
	    <#if (columnInfo_index%2==1) || (columnInfo_index==(serviceInfo.columns?size)-1)>
	    </div>
	    </#if>
	</#list>
		<input id="win-submit" lay-submit lay-filter="win-submit" hidden="true"/>
	</form>
</div>
<!-- windows弹窗定义结束 -->
<!-- 查询windows弹窗定义开始 -->
<div id="windows-search" style="display: none;">
	<form class="layui-form layui-fluid" id="win-search-form" lay-filter="win-search-form" action="javascript:;">
	<#list serviceInfo.columns as columnInfo>
	    <#if (columnInfo_index%3==0)>
	    <div class="layui-form-item">
	    </#if>
	    	<!-- 搜索窗口：<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}<#else>${columnInfo.columnCode}</#if>属性 -->
	        <div class="layui-inline">
	            <label class="layui-form-label"><#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}<#else>${columnInfo.columnCode}</#if></label>
	            <div class="layui-input-inline">
	            <#if (columnInfo.javaType="Boolean")>
				  <select name="${columnInfo.javaCode}" lay-verify="">
					<option value="">${columnInfo.columnRemark!}</option>
					<option value="1">是</option>
					<option value="0">否</option>
				  </select>
				<#elseif (columnInfo.dataType="enum")>
				  <select name="${columnInfo.javaCode}" lay-verify="">
					<option value="">${columnInfo.columnRemark!}</option>
					<${r'#'}list ${columnInfo.tableClazzCode?uncap_first}${columnInfo.javaCode?cap_first}Enum as item>
					<option value="${r'$'}{item.code}">${r'$'}{item.message}</option>
					</${r'#'}list>
				  </select>
				<#elseif (columnInfo.dataType == "datetime")||(columnInfo.dataType == "timestamp")>
				    <div class="layui-inline">
					  <input class="layui-input" type="text" id="${columnInfo.javaCode}${columnInfo.TIMESTARTSTR}-win" name="${columnInfo.javaCode}${columnInfo.TIMESTARTSTR}" autocomplete="off" placeholder="<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}开始<#else>${columnInfo.columnCode}${columnInfo.TIMESTARTSTR}</#if>" readonly />
				    </div>
				    <div class="layui-inline">
					  <input class="layui-input" type="text" id="${columnInfo.javaCode}${columnInfo.TIMEENDSTR}-win" name="${columnInfo.javaCode}${columnInfo.TIMEENDSTR}" autocomplete="off" placeholder="<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}截止<#else>${columnInfo.columnCode}${columnInfo.TIMEENDSTR}</#if>" readonly />
				    </div>
	            <#else>
	                <input class="layui-input" <#if (columnInfo.dataType=="bigint"||columnInfo.dataType=="int"||columnInfo.dataType=="double"||columnInfo.dataType=="decimal"||columnInfo.dataType=="float")>type="number"<#else>type="text"</#if> id="${columnInfo.javaCode}-win" name="${columnInfo.javaCode}" placeholder="<#if (columnInfo.columnRemark?string != "")>${columnInfo.columnRemark}<#else>${columnInfo.columnCode}</#if>" <#if (!columnInfo.nullAble)&&(!columnInfo.prikey)>lay-verify="required"</#if> autocomplete="off" />
	            </#if>
	            </div>
	        </div>
	    <#if (columnInfo_index%3==2) || (columnInfo_index==(serviceInfo.columns?size)-1)>
	    </div>
	    </#if>
	</#list>
	</form>
</div>
<!-- 查询windows弹窗定义结束 -->
</html>